import DragTargetComponentV2 from "../../common/components/drag/DragTargetComponentV2";
import DragQuestionPluginV2 from "../../common/components/DragQuestionPluginV2";
import { QuestionCorrect, ShowEnergy } from "../../common/model/QuestionModel";

const { ccclass, property } = cc._decorator;

@ccclass
export default class HL10J1 extends DragQuestionPluginV2 {

    @property([cc.SpriteFrame])
    arr: cc.SpriteFrame[] = []
    /** 提交后的效果 ，子类重写*/
    submitExerciseEffect(isCorrect: QuestionCorrect, showEnergy?: ShowEnergy) {
        if (isCorrect == QuestionCorrect.CORRECT) {
            this._submitDelayTime = 2;
            this.playCorrectSound();
            this.playCorrectEffect();

            //变化图片
            this.targetNodeList.forEach((target) => {
                let drag_copyNode = this.node.getChildByName(target.getComponent(DragTargetComponentV2).getOrgNodeNameList()[0])
                drag_copyNode.getComponent(cc.Sprite).spriteFrame = this.arr[Number(drag_copyNode.name[4]) - 1]
                drag_copyNode.scale=1
            })









        }
    }

}
